package com.wangjie.arraylist;

import java.util.Comparator;

/**
 * 字符串长度比较器
 */
public class MyCommparator implements Comparator<String> {
    @Override
    public int compare(String o1, String o2) {
        if (o1.length() > o2.length()) return 1;
        else if(o1.length() < o2.length()) return -1;
        return 0;
    }
}
